package org.redmagic.service.spring;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import org.redmagic.agent.spring.RedMagicStringValueResolver;

/**
 * Caches properties that it knows will not be resolved by the service, so that it does not recheck them.
 */
public class CachingRedMagicStringValueResolver extends RedMagicStringValueResolver {

	private Set<String> knownMissingProperties;
	
	public CachingRedMagicStringValueResolver() {
		this.knownMissingProperties = new HashSet<String>();
	}
	
	public void addMissingPlaceholder(String missingProperty) {
		this.knownMissingProperties.add(missingProperty);
	}
	
	public void addAllMissingPlaceholders(Collection<String> missingProperties) {
		this.knownMissingProperties.addAll(missingProperties);
	}

	public Set<String> getKnownMissingProperties() {
		return knownMissingProperties;
	}

}
